package com.xsr.mapper;

import com.xsr.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project xiaomi
 * @date 2022/9/13 17:52
 */
public interface UserMapper {
      @Select("select * from tb_user where username=#{username} and password=#{password}")
    User selectByNameAndPwd(@Param("username") String username, @Param("password") String password);
@Select("select * from tb_user where username=#{username}")
    User selectByName(String username);
     @Insert("insert into tb_user values(null,#{username},#{password},#{email},#{gender},#{flag},#{role},#{code})")
    int addUser(User user);
}
